#!/bin/bash


# 重命名face文件夹下图片

RANDOM_PREFIX="tmp"


# $1 rename dir
# $2 new prefix
# $3 new suffix
sort_rename()
{
    cd $1 > /dev/null

    count=1
    for file in $(ls)
    do
        mv "$file" "$RANDOM_PREFIX$count"
        count=$((count+1))
    done
    count=1
    for file in $(ls)
    do
		mv "$file" "$2$count$3"
        count=$((count+1))
    done
    
    cd - > /dev/null
}

sort_rename face face_ .jpg
sort_rename not_face not_face_ .jpg
